package com.jt.tenant.conn;

import com.jt.tenant.app.JTApplication;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/3/7.
 */
@HttpInlet(Conn.INLET_ACCOUNT_SETTING)
public class GetAccountSettings extends JTAsyGet {

    ///CPSP-SER2/v1/user/setUserInfo.json?token=当前会话的唯一标示&nickName=昵称&headPic=头像
    // &emergencyContact=紧急联系人&emergencyContactPhone=紧急联系人电话&driverNum=驾驶证号&driverEffectiveDate=驾驶证有效起始日期&driverEffectiveYear=有效期限
    public String token = JTApplication.jtPreferences.readToken();

    public String nickName;

    public String headPic;

    public String emergencyContactPhone;

    public String driverNum;

    public String driverEffectiveDate;

    public String driverEffectiveYear;

    public String sex;

    public GetAccountSettings(String nickName, String headPic, String emergencyContactPhone, String driverNum, String driverEffectiveDate, String driverEffectiveYear,String sex, AsyCallBack asyCallBack) {
        super(asyCallBack);

        this.nickName = nickName;
        this.headPic = headPic;
        this.emergencyContactPhone = emergencyContactPhone;
        this.driverNum = driverNum;
        this.driverEffectiveDate = driverEffectiveDate;
        this.driverEffectiveYear = driverEffectiveYear;
        this.sex = sex;
    }

    @Override
    protected Object parser(JSONObject object) {
//        JSONObject apiTYF = object.optJSONObject("apiTYF");
//
//        JSONObject head = apiTYF.optJSONObject("head");

        Info info = new Info();

//        info.msg = head.optString("msg");
//
//        JSONObject body = apiTYF.optJSONObject("body");

        return info;
    }

    public static class Info {

        public String msg;

        public String activatState, tag, cardAvailableTime;
    }
}
